package com.ruoyi.project.module.yuQing.controller;

import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.project.module.yuQing.domain.YuQing;
import com.ruoyi.project.module.yuQing.service.IYuQingService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.framework.web.domain.Message;

/**
 * 操作日志记录 信息操作处理
 * 
 * @author ruoyi
 * @date 2018-12-04
 */
@Controller
@RequestMapping("/module/yuQing")
public class YuQingController extends BaseController
{
    private String prefix = "module/yuQing";
	
	@Autowired
	private IYuQingService yuQingService;
	
	@GetMapping()
	@RequiresPermissions("module:yuQing:view")
	public String yuQing()
	{
	    return prefix + "/yuQing";
	}
	
	/**
	 * 查询操作日志记录列表
	 */
	@RequiresPermissions("module:yuQing:list")
	@GetMapping("/list")
	@ResponseBody
	public TableDataInfo list(YuQing yuQing)
	{
		startPage();
        List<YuQing> list = yuQingService.selectYuQingList(yuQing);
		return getDataTable(list);
	}
	
	/**
	 * 查询操作日志记录列表
	 */
	@RequiresPermissions("module:yuQing:list1")
	@GetMapping("/list1")
	@ResponseBody
	public TableDataInfo list1(YuQing yuQing)
	{
		startPage();
        List<YuQing> list = yuQingService.selectYuQingListByTime(yuQing);
		return getDataTable(list);
	}
	
	/**
	 * 查询操作日志记录列表
	 */
	@RequiresPermissions("module:yuQing:list2")
	@GetMapping("/list2")
	@ResponseBody
	public TableDataInfo list2(YuQing yuQing)
	{
		startPage();
        List<YuQing> list = yuQingService.selectYuQingListByTime2(yuQing);
		return getDataTable(list);
	}
	
	/**
	 * 查询操作日志记录列表
	 */
	@RequiresPermissions("module:yuQing:list3")
	@GetMapping("/list3")
	@ResponseBody
	public TableDataInfo list3(YuQing yuQing)
	{
		startPage();
        List<YuQing> list = yuQingService.selectYuQingListByTime3(yuQing);
		return getDataTable(list);
	}
	
	/**
	 * 查询操作日志记录列表
	 */
	@RequiresPermissions("module:yuQing:list4")
	@GetMapping("/list4")
	@ResponseBody
	public TableDataInfo list4(YuQing yuQing)
	{
		startPage();
        List<YuQing> list = yuQingService.selectYuQingListByMotion(yuQing);
		return getDataTable(list);
	}
	
	/**
	 * 查询操作日志记录列表
	 */
	@RequiresPermissions("module:yuQing:list5")
	@GetMapping("/list5")
	@ResponseBody
	public TableDataInfo list5(YuQing yuQing)
	{
		startPage();
        List<YuQing> list = yuQingService.selectYuQingListByMotion2(yuQing);
		return getDataTable(list);
	}
	
	/**
	 * 查询操作日志记录列表
	 */
	@RequiresPermissions("module:yuQing:list6")
	@GetMapping("/list6")
	@ResponseBody
	public TableDataInfo list6(YuQing yuQing)
	{
		startPage();
        List<YuQing> list = yuQingService.selectYuQingListByMotion3(yuQing);
		return getDataTable(list);
	}
	
	/**
	 * 查询操作日志记录列表
	 */
	@RequiresPermissions("module:yuQing:listjiao")
	@GetMapping("/listjiao")
	@ResponseBody
	public TableDataInfo listjiao(YuQing yuQing)
	{
		startPage();
        List<YuQing> list = yuQingService.selectYuQingListByJiaoyu(yuQing);
		return getDataTable(list);
	}
	
	/**
	 * 查询操作日志记录列表
	 */
	@RequiresPermissions("module:yuQing:listshuang")
	@GetMapping("/listshuang")
	@ResponseBody
	public TableDataInfo listshuang(YuQing yuQing)
	{
		startPage();
        List<YuQing> list = yuQingService.selectYuQingListByShuang(yuQing);
		return getDataTable(list);
	}
	
	/**
	 * 查询操作日志记录列表
	 */
	@RequiresPermissions("module:yuQing:listxue")
	@GetMapping("/listxue")
	@ResponseBody
	public TableDataInfo listxue(YuQing yuQing)
	{
		startPage();
        List<YuQing> list = yuQingService.selectYuQingListByXuesheng(yuQing);
		return getDataTable(list);
	}
	
	/**
	 * 查询操作日志记录列表
	 */
	@RequiresPermissions("module:yuQing:listan")
	@GetMapping("/listan")
	@ResponseBody
	public TableDataInfo listan(YuQing yuQing)
	{
		startPage();
        List<YuQing> list = yuQingService.selectYuQingListByAnquan(yuQing);
		return getDataTable(list);
	}
	
	/**
	 * 查询操作日志记录列表
	 */
	@RequiresPermissions("module:yuQing:listyu")
	@GetMapping("/listyu")
	@ResponseBody
	public TableDataInfo listyu(YuQing yuQing)
	{
		startPage();
        List<YuQing> list = yuQingService.selectYuQingListByYule(yuQing);
		return getDataTable(list);
	}
	
	/**
	 * 新增操作日志记录
	 */
	@RequiresPermissions("module:yuQing:add")
	@GetMapping("/add")
	public String add()
	{
	    return prefix + "/add";
	}

	/**
	 * 修改操作日志记录
	 */
	@RequiresPermissions("module:yuQing:edit")
	@GetMapping("/edit/{id}")
	public String edit(@PathVariable("id") Integer id, Model model)
	{
		YuQing yuQing = yuQingService.selectYuQingById(id);
		model.addAttribute("yuQing", yuQing);
	    return prefix + "/edit";
	}
	
	/**
	 * 保存操作日志记录
	 */
	@RequiresPermissions("module:yuQing:save")
	@PostMapping("/save")
	@ResponseBody
	public Message save(YuQing yuQing)
	{
		if (yuQingService.saveYuQing(yuQing) > 0)
		{
			return Message.success();
		}
		return Message.error();
	}
	
	/**
	 * 删除操作日志记录
	 */
	@RequiresPermissions("module:yuQing:remove")
	@PostMapping( "/remove/{id}")
	@ResponseBody
	public Message remove(@PathVariable("id") Integer id)
	{
		if (yuQingService.deleteYuQingById(id) > 0)
		{
		    return Message.success();
		}
		return Message.error();
	}
	
	/**
	 * 批量删除操作日志记录
	 */
	@RequiresPermissions("module:yuQing:batchRemove")
	@PostMapping( "/batchRemove")
	@ResponseBody
	public Message remove(@RequestParam("ids[]") Integer[] ids)
	{
		int rows = yuQingService.batchDeleteYuQing(ids);
		if (rows > 0)
        {
            return Message.success();
        }
        return Message.error();
	}
	
}
